module.exports = options => {
    return async (req, res, next) => {
        const sortName = require('inflection').classify(req.params.sort)
        const modelName = require('inflection').classify(req.params.resource)
        const Model = require(`../models/${sortName}/${modelName}`)
        req.Model = Model
        await  next()
    }
  }